import time

def x (sam):
  flag = True
  while flag == True:
    flag = False
    for i in range(len(sam) - 1):
        if int(sam[i]) >  int(sam[i + 1]):
            sam[i] , sam[i + 1] = sam[i + 1], sam[i]
            flag = True
  return sam
            
f1 = open('m1_sorted.txt')
ar1 = f1.readlines()
th = time.time()
ar1 = x(ar1)
tf = time.time()
print('время m1', round((tf - th)) * 1000, 'mc')

f2 = open('m1_sorted.txt')
ar2 = f2.readlines()
th = time.time()
ar2 = x(ar2)
tf = time.time()
print('время m2', round((tf - th)) * 1000, 'mc')

f3 = open('m1_sorted.txt')
ar3 = f3.readlines()
th = time.time()
ar2 = x(ar3)
tf = time.time()
print('время m3', round((tf - th)) * 1000, 'mc')
            

'''
for i in array2:
    print (i, end=' ')
'''